package com.chengzzz.mysite.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Date;

/**
 * (User)表实体类
 *
 * @author 等什么柠檬君
 * @since 2020-08-24 14:26:50
 */
@SuppressWarnings("serial")

@ApiModel("用户实体类")
public class User extends Model<User> {

    @ApiModelProperty("雪花算法唯一id")
    @TableId(type = IdType.ASSIGN_ID)
    private String  uid;

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("邮箱即账号")
    private String email;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("用户角色")
    private String roles;

    @ApiModelProperty("用户状态")
    private String state;

    @ApiModelProperty("注册ip")
    private String registeip;

    @ApiModelProperty("登录ip")
    private String loginip;

    @ApiModelProperty("现行时间戳")
    private String timesamp;

    @ApiModelProperty("记录创建时间")
    private Date gmt_create;

    @ApiModelProperty("记录更新时间")
    private Date gmt_update;

    @ApiModelProperty("记录逻辑删除")
    @TableLogic(value="0",delval="1")
    private int deleted;

    @ApiModelProperty("用户权限")
    private String perms;

    @ApiModelProperty("用户头像")
    private String avatar;

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    public Date getGmt_create() {
        return gmt_create;
    }

    public void setGmt_create(Date gmt_create) {
        this.gmt_create = gmt_create;
    }

    public Date getGmt_update() {
        return gmt_update;
    }

    public void setGmt_update(Date gmt_update) {
        this.gmt_update = gmt_update;
    }

    public User(String email, String password, String registeip) {
        this.email = email;
        this.password = password;
        this.registeip = registeip;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRoles() {
        return roles;
    }

    public void setRoles(String roles) {
        this.roles = roles;
    }

    public String getPerms() {
        return perms;
    }

    public void setPerms(String perms) {
        this.perms = perms;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getRegisteip() {
        return registeip;
    }

    public void setRegisteip(String registeip) {
        this.registeip = registeip;
    }

    public String getLoginip() {
        return loginip;
    }

    public void setLoginip(String loginip) {
        this.loginip = loginip;
    }

    public String getTimesamp() {
        return timesamp;
    }

    public void setTimesamp(String timesamp) {
        this.timesamp = timesamp;
    }

    @Override
    public String toString() {
        return "User{" +
                "uid=" + uid +
                ", username='" + username + '\'' +
                ", email='" + email + '\'' +
                ", password='" + password + '\'' +
                ", roles='" + roles + '\'' +
                ", state='" + state + '\'' +
                ", registeip='" + registeip + '\'' +
                ", loginip='" + loginip + '\'' +
                ", timesamp='" + timesamp + '\'' +
                ", gmt_create=" + gmt_create +
                ", gmt_update=" + gmt_update +
                ", deleted=" + deleted +
                ", perms='" + perms + '\'' +
                ", avatar='" + avatar + '\'' +
                '}';
    }

    /**
     * 获取主键值
     *
     * @return 主键值
     */


    @Override
    protected Serializable pkVal() {
        return this.uid;
    }
}